$(document).ready(function(){
var banner = document.getElementsByClassName("banner")[0];
var arr = [];
   for(var i = 0; i < 5; i ++){
       $.ajax({
    type: "get",
    url: "https://ecpm.tanx.com/ex?i=mm_12852562_1778064_13672849&cb=jsonp_callback_5496&r=&cg=a328a5a8bfb14073445a893e2888eb66&pvid=e9a1151e2bbb9d41d9c5127d42c29116&u=https%3A%2F%2Fwww.taobao.com%2F&psl=1&nk=&sk=&refpid=",
    dataType:"jsonp",
    // data: {

    //     i : 
    // },
    success: function (data) {
        arr.push(data.data)
        // n.innerHTML = `<p>${data.images[0].copyright}</p><img src="${data.images[0].url}"><span>${data.images[0].startdate}</span>`;
    }

});
};
window.onload=function(){
    console.log("end")
    banner.innerHTML = ` 
<li class="img"><img src="${arr[0]}" alt=""></li>
<li class="img"><img src="${arr[1]}" alt=""></li>
<li class="img"><img src="${arr[2]}" alt=""></li>
<li class="img"><img src="${arr[3]}" alt=""></li>
<li class="img"><img src="${arr[4]}" alt=""></li>
<li class="img"><img src="${arr[0]}" alt=""></li>`
 
};




});//轮播图数据


$(document).ready(function(){
    var input_text = document.getElementsByClassName("input_text")[0];
    var search_list = document.getElementsByClassName("search-list-t")[0];
     var object = null;
   
    input_text.addEventListener('input',function(){
        if(!input_text.value){
            console.log("ss")
            search_list.style.display = "none";
            return;
        }
       
       if(input_text.value){ 
        search_list.style.display = "flex";
           
        $.ajax({
        type: "get",
        url: "https://suggest.taobao.com/sug?code=utf-8&q=&_ksTS=1587923430038_616&callback=jsonp617&k=1&area=c2c&bucketid=10",
        dataType: "jsonp",
        data:{
            q : (input_text.value)
        },
        success: function(data){
            
             object = data.result;
          
             

        }

     });
     if(object.length > 0){
         search_list.innerHTML=`
     <li>${object[0][0]}</li>
     <li>${object[1][0]}</li>
     <li>${object[2][0]}</li>
     <li>${object[3][0]}</li>
     <li>${object[4][0]}</li>
     <li>${object[5][0]}</li>
     <li>${object[6][0]}</li>
`;
}
        

     
    
    };
   

    
      


    });





});//搜索框数据



